package com.zbkj.admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户余额记录表 实体类。
 *
 * @author mybatis-flex-helper automatic generation
 * @since 1.0
 */
@Accessors(chain = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "用户余额记录表")
@TableName(value = "eb_user_balance_record")
@Table(value = "eb_user_balance_record")
public class EbUserBalanceRecordEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 记录id
     */
    @Schema(description = "记录id")
    @Id(keyType = KeyType.Auto)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 用户uid
     */
    @Schema(description = "用户uid")
    @Column(value = "uid")
    @TableField(value = "uid")
    private Integer uid;

    /**
     * 关联id(订单号、充值单号)(system默认为0）
     */
    @Schema(description = "关联id(订单号、充值单号)(system默认为0）")
    @Column(value = "link_id")
    @TableField(value = "link_id")
    private String linkId;

    /**
     * 关联类型:order-订单,recharge-充值,system-系统,brokerage-佣金转余额
     */
    @Schema(description = "关联类型:order-订单,recharge-充值,system-系统,brokerage-佣金转余额")
    @Column(value = "link_type")
    @TableField(value = "link_type")
    private String linkType;

    /**
     * 类型：1-增加，2-扣减，3-冻结
     */
    @Schema(description = "类型：1-增加，2-扣减，3-冻结")
    @Column(value = "type")
    @TableField(value = "type")
    private Integer type;

    /**
     * 金额
     */
    @Schema(description = "金额")
    @Column(value = "amount")
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 剩余
     */
    @Schema(description = "剩余")
    @Column(value = "balance")
    @TableField(value = "balance")
    private BigDecimal balance;

    /**
     * 备注
     */
    @Schema(description = "备注")
    @Column(value = "remark")
    @TableField(value = "remark")
    private String remark;

    /**
     * 添加时间
     */
    @Schema(description = "添加时间")
    @Column(value = "create_time")
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 是否可用(0:有效，1：失效),
     */
    @Schema(description = "是否可用(0:有效，1：失效)")
    @Column(value = "data_status", isLogicDelete = true)
    @TableField(value = "data_status")
    private Integer dataStatus;


}
